// const BASEURL = "http://192.168.1.194:9000";
// const BASEURL = "https://yimiao-prd.e-hqins.com";
const BASEURL = "https://yimiao-uat.e-hqins.com";
export default function request (options) {
  const TOKEN = wx.getStorageSync('usertoken');
  return new Promise((resolve, reject) => {
    wx.request({
      url: BASEURL + options.url,
      method: options.method || "POST",
      responseType: options.resType || "text",
      header: {
        'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
        'Authorization': TOKEN
      },
      data: options.data || {},
      success: resolve,
      fail: reject
    })
  })
}
